import request from '@/utils/request';
export async function Create(params: any, control: string) {
  return request('/api/services/app/' + control + '/Create', {
    method: 'POST',
    data: params,
  });
}
export async function Update(params: any, control: string) {
  return request('/api/services/app/' + control + '/Update', {
    method: 'PUT',
    data: params,
  });
}
export async function Delete(params: any, control: string) {
  return request('/api/services/app/' + control + '/Delete', {
    method: 'DELETE',
    params,
  });
}
export async function DelBatch(params: any, control: string) {
  return request('/api/services/app/' + control + '/DelBatch', {
    method: 'POST',
    data: params,
  });
}
export async function Remove(params: any, control: string) {
  return request('/api/services/app/' + control + '/Remove', {
    method: 'DELETE',
    params,
  });
}
export async function Get(params: any, control: string) {
  return request('/api/services/app/' + control + '/Get', {
    method: 'GET',
    params,
  });
}
export async function GetAll(params: any, control: string) {
  return request('/api/services/app/' + control + '/GetAll', {
    method: 'GET',
    params,
  });
}
export async function GetList(params: any, control: string) {
  return request('/api/services/app/' + control + '/GetList', {
    method: 'GET',
    params,
  });
}
export async function GetTreeList(params: any, control: string) {
  return request('/api/services/app/' + control + '/GetTreeListAsync', {
    method: 'GET',
    params,
  });
}

export async function abpIsTenantAvailable(params: any) {
  return request('/api/services/app/Account/IsTenantAvailable', {
    method: 'POST',
    data: params,
  });
}
export async function GetAllPermissions() {
  return request('/api/services/app/Role/GetAllPermissions', {
    method: 'GET',
  });
}

export async function ChangePassword(params: any) {
  return request('/api/services/app/User/ChangePassword', {
    method: 'POST',
    data: params,
  });
}

export async function GetListByCustAsync(params: any) {
  return request('/api/services/app/UserPayChanel/GetListByCustAsync', {
    method: 'GET',
    params,
  });
}

export async function EnablePayChanelAsync(params: any) {
  return request('/api/services/app/UserPayChanel/EnablePayChanelAsync', {
    method: 'POST',
    params,
  });
}
export async function GetOptsAsync(params: any) {
  return request('/api/services/app/UserPayChanel/GetOptsAsync', {
    method: 'GET',
    params,
  });
}

export async function GetTreeData(params: any) {
  return request('/api/services/app/Category/GetTreeDataAsync', {
    method: 'GET',
    params,
  });
}
export async function GetAllByPart(params: any, control: string) {
  return request('/api/services/app/' + control + '/GetAllByPart', {
    method: 'GET',
    params,
  });
}
export async function GetFileExt() {
  return request('/api/services/app/Attachment/GetFileExtAsync', {
    method: 'GET',
  });
}
export async function NewObj(params: any, control: string) {
  return request('/api/services/app/' + control + '/New', {
    method: 'POST',
    data: params,
  });
}
export async function Modify(params: any, control: string) {
  return request('/api/services/app/' + control + '/Modify', {
    method: 'POST',
    data: params,
  });
}
export async function GetItems(params: any, control: string) {
  return request('/api/services/app/' + control + '/GetItems', {
    method: 'GET',
    params,
  });
}
export async function GetMenus(params: any) {
  return request('/api/services/app/User/GetMenus', {
    method: 'GET',
    params,
  });
}
export async function ExportExcel(params: any, control: string) {
  return request('/api/services/app/' + control + '/ExportExcel', {
    method: 'POST',
    params,
    responseType: 'blob',
  });
}
export async function InvAdjust(params: any) {
  return request('/api/services/app/PartBin/InvAdjust', {
    method: 'POST',
    data: params,
  });
}
export async function AddStock(params: any) {
  return request('/api/services/app/PartBin/AddStock', {
    method: 'POST',
    data: params,
  });
}
export async function GetIssueMtl(params: any) {
  return request('/api/services/app/JobMtl/GetIssueMtl', {
    method: 'GET',
    params,
  });
}
export async function IssueMtl(params: any) {
  return request('/api/services/app/JobMtl/IssueMtl', {
    method: 'POST',
    data: params,
  });
}
export async function ReturnMtl(params: any) {
  return request('/api/services/app/JobMtl/ReturnMtl', {
    method: 'POST',
    data: params,
  });
}
